import React, { useEffect, useRef, useState } from "react";
import "./Hero.css";
import axios from "axios";
import Search from "./Search";
import List from "./List";
import { useNavigate } from "react-router";
// 接口地址: http://api.xiaohigh.com/heros
// 接口地址: http://api.xiaohigh.com/heros?name_like=李
export default function HeroList() {
  //获取跳转函数
  let navigate = useNavigate();
  return (
    <div className="hero-container">
      <button onClick={() => {
        //跳转
        navigate(1);
      }}>前进</button>
      <h2>王者荣耀</h2>
      <hr />
      <Search />
      <hr />
      <List />
    </div>
  );
}
